1
bash
This demonstrates using the IFS variable to split a comma-separated string and iterate over its elements in a for loop.
IFS=',' string="apple,banana,cherry" for fruit in $string; do echo "Fruit: $fruit" done
bash internaldata manipulationsstring manipulation and expansionsIFS (Internal Field Separator)